﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace SportStore.DomainModel.Entities
{
    public class ShippingDetails : IDataErrorInfo
    {
        public string Name { get; set; }
        public string Line1 { get; set; }
        public string Line2 { get; set; }
        public string Line3 { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string Zip { get; set; }
        public string Country { get; set; }
        public bool GiftWrap { get; set; }

        public  string this[string columnsName]
        {
            get
            {
                if ((columnsName == "Name") && string.IsNullOrEmpty(Name)) return "Please enter a name";
                if ((columnsName == "Line1") && string.IsNullOrEmpty(Line1))
                    return "Please enter the first address line";
                if ((columnsName == "City") && string.IsNullOrEmpty(City)) return "Please enter a city name";
                if ((columnsName == "State") && string.IsNullOrEmpty(State)) return "Please enter a state name";
                if ((columnsName == "Country") && string.IsNullOrEmpty(Country)) return "Please enter a county name";
                return null;
            }
        }

        public string Error { get { return null; } }

    }
}
